"use strict";
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (this && this.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
    return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (g && (g = 0, op[0] && (_ = 0)), _) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
        if (ar || !(i in from)) {
            if (!ar) ar = Array.prototype.slice.call(from, 0, i);
            ar[i] = from[i];
        }
    }
    return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", { value: true });
var vue_1 = require("vue");
var ant_design_vue_1 = require("ant-design-vue");
var pictureController_ts_1 = require("@/api/pictureController.ts");
var vue_router_1 = require("vue-router");
var formData = (0, vue_1.reactive)({
    count: 10,
});
// 提交任务状态
var loading = (0, vue_1.ref)(false);
var router = (0, vue_router_1.useRouter)();
/**
 * 提交表单
 * @param values
 */
var handleSubmit = function (values) { return __awaiter(void 0, void 0, void 0, function () {
    var res;
    return __generator(this, function (_a) {
        switch (_a.label) {
            case 0:
                loading.value = true;
                return [4 /*yield*/, (0, pictureController_ts_1.uploadPictureByBatchUsingPost)(__assign({}, formData))
                    // 操作成功
                ];
            case 1:
                res = _a.sent();
                // 操作成功
                if (res.data.code === 0 && res.data.data) {
                    ant_design_vue_1.message.success("\u521B\u5EFA\u6210\u529F\uFF0C\u5171 ".concat(res.data.data, " \u6761"));
                    // 跳转到主页
                    router.push({
                        path: "/",
                    });
                }
                else {
                    ant_design_vue_1.message.error('创建失败，' + res.data.message);
                }
                loading.value = false;
                return [2 /*return*/];
        }
    });
}); }; /* PartiallyEnd: #3632/scriptSetup.vue */
function __VLS_template() {
    var __VLS_ctx = {};
    var __VLS_components;
    var __VLS_directives;
    // CSS variable injection 
    // CSS variable injection end 
    __VLS_elementAsFunction(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
        id: ("addPictureBatchPage"),
    });
    __VLS_elementAsFunction(__VLS_intrinsicElements.h2, __VLS_intrinsicElements.h2)(__assign({ style: ({}) }));
    var __VLS_0 = {}.AForm;
    /** @type { [typeof __VLS_components.AForm, typeof __VLS_components.aForm, typeof __VLS_components.AForm, typeof __VLS_components.aForm, ] } */ ;
    // @ts-ignore
    var __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0(__assign({ 'onFinish': {} }, { name: ("formData"), layout: ("vertical"), model: ((__VLS_ctx.formData)) })));
    var __VLS_2 = __VLS_1.apply(void 0, __spreadArray([__assign({ 'onFinish': {} }, { name: ("formData"), layout: ("vertical"), model: ((__VLS_ctx.formData)) })], __VLS_functionalComponentArgsRest(__VLS_1), false));
    var __VLS_6;
    var __VLS_7 = {
        onFinish: (__VLS_ctx.handleSubmit)
    };
    var __VLS_3;
    var __VLS_4;
    var __VLS_8 = {}.AFormItem;
    /** @type { [typeof __VLS_components.AFormItem, typeof __VLS_components.aFormItem, typeof __VLS_components.AFormItem, typeof __VLS_components.aFormItem, ] } */ ;
    // @ts-ignore
    var __VLS_9 = __VLS_asFunctionalComponent(__VLS_8, new __VLS_8({
        name: ("searchText"),
        label: ("关键词"),
    }));
    var __VLS_10 = __VLS_9.apply(void 0, __spreadArray([{
            name: ("searchText"),
            label: ("关键词"),
        }], __VLS_functionalComponentArgsRest(__VLS_9), false));
    var __VLS_14 = {}.AInput;
    /** @type { [typeof __VLS_components.AInput, typeof __VLS_components.aInput, ] } */ ;
    // @ts-ignore
    var __VLS_15 = __VLS_asFunctionalComponent(__VLS_14, new __VLS_14({
        value: ((__VLS_ctx.formData.searchText)),
        placeholder: ("请输入关键词"),
        allowClear: (true),
    }));
    var __VLS_16 = __VLS_15.apply(void 0, __spreadArray([{
            value: ((__VLS_ctx.formData.searchText)),
            placeholder: ("请输入关键词"),
            allowClear: (true),
        }], __VLS_functionalComponentArgsRest(__VLS_15), false));
    __VLS_13.slots.default;
    var __VLS_13;
    var __VLS_20 = {}.AFormItem;
    /** @type { [typeof __VLS_components.AFormItem, typeof __VLS_components.aFormItem, typeof __VLS_components.AFormItem, typeof __VLS_components.aFormItem, ] } */ ;
    // @ts-ignore
    var __VLS_21 = __VLS_asFunctionalComponent(__VLS_20, new __VLS_20({
        name: ("count"),
        label: ("抓取数量"),
    }));
    var __VLS_22 = __VLS_21.apply(void 0, __spreadArray([{
            name: ("count"),
            label: ("抓取数量"),
        }], __VLS_functionalComponentArgsRest(__VLS_21), false));
    var __VLS_26 = {}.AInputNumber;
    /** @type { [typeof __VLS_components.AInputNumber, typeof __VLS_components.aInputNumber, ] } */ ;
    // @ts-ignore
    var __VLS_27 = __VLS_asFunctionalComponent(__VLS_26, new __VLS_26(__assign(__assign({ value: ((__VLS_ctx.formData.count)), placeholder: ("请输入数量") }, { style: ({}) }), { min: ((1)), max: ((30)), allowClear: (true) })));
    var __VLS_28 = __VLS_27.apply(void 0, __spreadArray([__assign(__assign({ value: ((__VLS_ctx.formData.count)), placeholder: ("请输入数量") }, { style: ({}) }), { min: ((1)), max: ((30)), allowClear: (true) })], __VLS_functionalComponentArgsRest(__VLS_27), false));
    __VLS_25.slots.default;
    var __VLS_25;
    var __VLS_32 = {}.AFormItem;
    /** @type { [typeof __VLS_components.AFormItem, typeof __VLS_components.aFormItem, typeof __VLS_components.AFormItem, typeof __VLS_components.aFormItem, ] } */ ;
    // @ts-ignore
    var __VLS_33 = __VLS_asFunctionalComponent(__VLS_32, new __VLS_32({
        name: ("namePrefix"),
        label: ("名称前缀"),
    }));
    var __VLS_34 = __VLS_33.apply(void 0, __spreadArray([{
            name: ("namePrefix"),
            label: ("名称前缀"),
        }], __VLS_functionalComponentArgsRest(__VLS_33), false));
    var __VLS_38 = {}.AInput;
    /** @type { [typeof __VLS_components.AInput, typeof __VLS_components.aInput, ] } */ ;
    // @ts-ignore
    var __VLS_39 = __VLS_asFunctionalComponent(__VLS_38, new __VLS_38({
        value: ((__VLS_ctx.formData.namePrefix)),
        placeholder: ("请输入名称前缀，会自动补充序号"),
        allowClear: (true),
    }));
    var __VLS_40 = __VLS_39.apply(void 0, __spreadArray([{
            value: ((__VLS_ctx.formData.namePrefix)),
            placeholder: ("请输入名称前缀，会自动补充序号"),
            allowClear: (true),
        }], __VLS_functionalComponentArgsRest(__VLS_39), false));
    __VLS_37.slots.default;
    var __VLS_37;
    var __VLS_44 = {}.AFormItem;
    /** @type { [typeof __VLS_components.AFormItem, typeof __VLS_components.aFormItem, typeof __VLS_components.AFormItem, typeof __VLS_components.aFormItem, ] } */ ;
    // @ts-ignore
    var __VLS_45 = __VLS_asFunctionalComponent(__VLS_44, new __VLS_44({}));
    var __VLS_46 = __VLS_45.apply(void 0, __spreadArray([{}], __VLS_functionalComponentArgsRest(__VLS_45), false));
    var __VLS_50 = {}.AButton;
    /** @type { [typeof __VLS_components.AButton, typeof __VLS_components.aButton, typeof __VLS_components.AButton, typeof __VLS_components.aButton, ] } */ ;
    // @ts-ignore
    var __VLS_51 = __VLS_asFunctionalComponent(__VLS_50, new __VLS_50(__assign(__assign({ type: ("primary"), htmlType: ("submit") }, { style: ({}) }), { loading: ((__VLS_ctx.loading)) })));
    var __VLS_52 = __VLS_51.apply(void 0, __spreadArray([__assign(__assign({ type: ("primary"), htmlType: ("submit") }, { style: ({}) }), { loading: ((__VLS_ctx.loading)) })], __VLS_functionalComponentArgsRest(__VLS_51), false));
    __VLS_55.slots.default;
    var __VLS_55;
    __VLS_49.slots.default;
    var __VLS_49;
    __VLS_5.slots.default;
    var __VLS_5;
    var __VLS_slots;
    var $slots;
    var __VLS_inheritedAttrs;
    var $attrs;
    var __VLS_refs = {};
    var $refs;
    var $el;
    return {
        attrs: {},
        slots: __VLS_slots,
        refs: $refs,
        rootEl: $el,
    };
}
;
var __VLS_self = (await Promise.resolve().then(function () { return __importStar(require('vue')); })).defineComponent({
    setup: function () {
        return {
            formData: formData,
            loading: loading,
            handleSubmit: handleSubmit,
        };
    },
});
exports.default = (await Promise.resolve().then(function () { return __importStar(require('vue')); })).defineComponent({
    setup: function () {
        return {};
    },
    __typeEl: {},
});
; /* PartiallyEnd: #4569/main.vue */
